<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message"/>
    
    <h:form id="registerForm">

        <rich:panel>
            <f:facet name="header">选择你要订餐的快餐店</f:facet>
    
            <s:decorate id="nameDecoration" template="layout/display.xhtml">
                <ui:define name="label">快餐店</ui:define>
				#{snackShop.name}
            </s:decorate>
			<s:decorate id="telDecoration" template="layout/display.xhtml">
				<ui:define name="label">电话</ui:define>
				#{snackShop.telNo}
			</s:decorate>
			<s:decorate id="addressDecoration" template="layout/display.xhtml">
				<ui:define name="label">地址</ui:define>
				#{snackShop.address}
			</s:decorate>  
			<s:decorate id="memoDecoration" template="layout/display.xhtml">
				<ui:define name="label">备注</ui:define>
				#{snackShop.memo}
			</s:decorate> 			          
            <div style="clear:both"/>
      </rich:panel>  
		 <div style="clear:both"/>
        <rich:panel>
            <f:facet name="header">点餐（#{orderDishesAction.dayString}）</f:facet>
	            <s:span rendered="#{snackShop.dishesForToday.size() == 0}" styleClass="required">没有菜？快找管理员录入！！</s:span>
	            <s:div rendered="#{snackShop.dishesForToday.size() >0}">
		            <s:decorate id="dishesDecoration" template="layout/edit.xhtml">
		                <ui:define name="label">菜单</ui:define>
						<h:selectManyCheckbox id="dishes" value="#{dishOrderAction.selectedDishes}" required="true"> 
							<s:selectItems value="#{snackShop.dishesForToday}" var="dish" label="#{dish.name}"/>
							<s:convertEntity />
						</h:selectManyCheckbox>
		            </s:decorate>
		        </s:div>
	            <div style="clear:both"/>
      </rich:panel> 
        <!-- actions -->
        <div class="actionButtons">
       
          <h:commandButton action="#{dishOrderAction.orderDishes}" value="订餐" styleClass="inputButton" rendered="#{snackShop.dishesForToday.size() >0}"/>
          <h:commandButton action="#{dishOrderAction.cancel}" value="取消" immediate="true" styleClass="inputButton"></h:commandButton>

        </div>     
 
    </h:form>
    
</ui:define>

</ui:composition>

